package br.com.appcalipse.domain;


import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import jmine.tec.persist.annotation.Alias;

import org.hibernate.validator.NotNull;

import bancosys.tec.component.Documentation;
import bancosys.tec.persist.authorization.annotation.DisplayName;
import bancosys.tec.persist.bussobj.PersistableBusinessObject;

/**
 * Representa um anuncio.
 * 
 * @author finx
 * @created Apr 25, 2013
 */
@Entity
@Table(name = "ANUNCIO")
@Alias("ANUNCI")
@DisplayName(value = "Anúncio")
@Documentation("ARMAZENA OS ANUNCIOS DO SISTEMA.")
@SequenceGenerator(name = "SEQ_ANUNCI", sequenceName = "SEQ_ANUNCI")
public class Anuncio extends PersistableBusinessObject {

	private Long id;
	
	private String usuario;
	
	private String carro;
	
	private String link;

	/**
	 * Construtor.
	 */
	protected Anuncio() {
		super();
	}
	
	/**
	 * @return the id
	 */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ_ANUNCI")
    @Column(name = "COD_ANUNCIO", nullable = false)
    @Documentation("CODIGO DO ANUNCIO.")
	public Long getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return the usuario
	 */
    @NotNull
    @Column(name = "USUARIO", nullable = false)
    @Documentation("USUARIO QUE FEZ O ANUNCIO.")
	public String getUsuario() {
		return usuario;
	}

	/**
	 * @param usuario the usuario to set
	 */
	public void setUsuario(String usuario) {
		this.usuario = usuario;
	}

	/**
	 * @return the carro
	 */
    @NotNull
    @Column(name = "CARRO", nullable = false)
    @Documentation("O CARRO ANUNCIADO.")
	public String getCarro() {
		return carro;
	}

	/**
	 * @param carro the carro to set
	 */
	public void setCarro(String carro) {
		this.carro = carro;
	}

	/**
	 * @return the link
	 */
    @NotNull
    @Column(name = "LINK", nullable = false)
    @Documentation("LINK DO ANUNCIO REAL.")
	public String getLink() {
		return link;
	}

	/**
	 * @param link the link to set
	 */
	public void setLink(String link) {
		this.link = link;
	}
	
}
